<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Gentelella Alela! | </title>
    <!-- Bootstrap -->
    <link th:href="@{/vendors/bootstrap/dist/css/bootstrap.min.css}" rel="stylesheet">
    <!-- Font Awesome -->
    <link th:href="@{vendors/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
    <!-- NProgress -->
    <link th:href="@{/vendors/nprogress/nprogress.css}" rel="stylesheet">
    <!-- Animate.css -->
    <link th:href="@{/vendors/animate.css/animate.min.css}" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link th:href="@{/build/css/custom.min.css}" rel="stylesheet">
</head>

<body class="login" style="background:url('/images/login_background.jpg') no-repeat;background-size: 100%;">
<div>
    <a class="hiddenanchor" id="signup"></a>
    <a class="hiddenanchor" id="signin"></a>

    <div class="login_wrapper">
        <div class="animate form login_form">
            <section class="login_content">
                <form th:action="@{/user/login}" id="login-form" onsubmit="return false;">
                    <h1 th:text="#{login.tip}"></h1>
                    <div>
                        <input type="text" name="username" class="form-control" th:placeholder="#{login.username}"/>
                    </div>
                    <div>
                        <input type="password" name="password" class="form-control" th:placeholder="#{login.password}"/>
                    </div>
                    <div>
                        <button class="btn btn-default" id="loginForm">[[#{login.btn}]]</button>
                    </div>

                    <div class="clearfix"></div>

                    <div class="separator">
                        <p class="change_link">
                            <a class="to_register" href="#">[[#{login.forgetPassword}]]?</a> |
                            <a href="#signup" class="to_register" style="margin-left: 15px">
                                [[#{login.createAccount}]] </a>
                        </p>

                        <div class="clearfix"></div>
                        <br/>

                        <div>
                            <h1>
                                <i class="fa fa-paw"></i>Gentelella MK!
                            </h1>
                            <p>©2016 All Rights Reserved. Gentelella MK! is a Bootstrap 3 template. Privacy and
                                Terms</p>
                        </div>
                        <p class="change_link">
                            <a class="to_register" href="?l=en_US">English</a> |
                            <a style="margin-left: 15px" class="to_register" href="?l=zh_CN"> 中文</a>
                        </p>
                    </div>
                </form>
            </section>
        </div>

        <div id="register" class="animate form registration_form">
            <section class="login_content">
                <form>
                    <h1> [[#{login.createAccount}]] </h1>
                    <div>
                        <input type="text" class="form-control" th:placeholder="#{login.username}" required=""/>
                    </div>
                    <div>
                        <input type="email" class="form-control" th:placeholder="#{email}" required=""/>
                    </div>
                    <div>
                        <input type="password" class="form-control" th:placeholder="#{login.password}" required=""/>
                    </div>
                    <div>
                        <a class="btn btn-default submit" href="index.html" th:text="#{login.register}"></a>
                    </div>

                    <div class="clearfix"></div>

                    <div class="separator">
                        <p class="change_link">[[#{login.hasAccount}]] ?
                            <a href="#signin" class="to_register"> [[#{login.btn}]] </a>
                        </p>

                        <div class="clearfix"></div>
                        <br/>
                        <div>
                            <h1><i class="fa fa-paw"></i> Gentelella MK!</h1>
                            <p>©2016 All Rights Reserved. Gentelella MK! is a Bootstrap 3 template. Privacy and
                                Terms</p>
                        </div>
                        <p class="change_link">
                            <a class="to_register" href="?l=en_US">English</a> |
                            <a style="margin-left: 15px" class="to_register" href="?l=zh_CN"> 中文</a>
                        </p>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
</body>
<script th:src="@{/vendors/jquery/dist/jquery.min.js}"></script>
<script th:src="@{/src/js/c.js}"></script>
<script th:src="@{/vendors/layer/layer.js}"></script>
<script type="text/javascript">
    $('#loginForm').on('click', function () {
        $c.ajax({
            form: $('#login-form'),
            success: function (d) {
                if (d.code == 200) {
                    window.location.href = "[[@{/index.html}]]";
                } else {
                    $c.notify(d.msg);
                }
            }
        })
    })
</script>
</html>


